package com.scatteredServer.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 发文表
 * @TableName posting
 */
@TableName(value ="posting")
@Data
public class Posting implements Serializable {
    /**
     * 主键递增
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 标题
     */
    private String title;

    /**
     * 正文
     */
    private String context;

    /**
     * 文件列表信息
     */
    private Object fileSaveList;

    /**
     * 教师已读未读信息
     */
    private Object teachersRead;

    /**
     * 最小阅读时间
     */
    private Integer minReadTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 备注
     */
    private String description;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Posting other = (Posting) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getContext() == null ? other.getContext() == null : this.getContext().equals(other.getContext()))
            && (this.getFileSaveList() == null ? other.getFileSaveList() == null : this.getFileSaveList().equals(other.getFileSaveList()))
            && (this.getTeachersRead() == null ? other.getTeachersRead() == null : this.getTeachersRead().equals(other.getTeachersRead()))
            && (this.getMinReadTime() == null ? other.getMinReadTime() == null : this.getMinReadTime().equals(other.getMinReadTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getContext() == null) ? 0 : getContext().hashCode());
        result = prime * result + ((getFileSaveList() == null) ? 0 : getFileSaveList().hashCode());
        result = prime * result + ((getTeachersRead() == null) ? 0 : getTeachersRead().hashCode());
        result = prime * result + ((getMinReadTime() == null) ? 0 : getMinReadTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", context=").append(context);
        sb.append(", fileSaveList=").append(fileSaveList);
        sb.append(", teachersRead=").append(teachersRead);
        sb.append(", minReadTime=").append(minReadTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}